abstract class Animal {
	abstract void cry();
	abstract String getAnimalName();
}	
class Dog extends Animal{
	void cry() {
		System.out.println("wangwang...");
	}
	String getAnimalName() {
		System.out.println("够");
		return null;
	}
}
class Cat extends Animal{
	void cry() {
		System.out.println("miaomiao");
	}
	String getAnimalName() {
		System.out.println("猫");
		return null;
	}
}
class Simulator{
	Animal dongwu;
	void playSound(Animal animal){
		dongwu=animal;
	}
	void showanimal() {
		dongwu.cry();
		dongwu.getAnimalName();
	}
}
public class Application {
	public static void main(String args[]) {
		Simulator simulator = new Simulator();
		simulator.playSound(new Dog());
		simulator.showanimal();
		simulator.playSound(new Cat());
		simulator.showanimal();
	}

}
